package com.qf.user.factory.loginfactory;

import com.qf.common.core.exception.CustomerException;
import com.qf.user.param.LoginParam;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author zdl
 * @date 2025/3/22
 */
@Component
public class LoginRationFactory {

    @Resource
    private PhoneAndVerificationCodeLoginRation phoneAndVerificationCodeLoginRation;
    @Resource
    private UserNameAndPassWordLoginRation userNameAndPassWordLoginRation;
    public LoginRation createLoginRation(Integer loginType){
        switch (loginType){
            case 1:
                return userNameAndPassWordLoginRation;
            case 2:
                return phoneAndVerificationCodeLoginRation;
            default:
                throw new CustomerException("2001","登录类型错误");
        }
    }
}
